class Settings {
  Settings({
    this.audio,
    this.dictionary,
    this.evaluation,
    this.id,
    this.lang,
    this.language,
    this.music,
    this.pinyin,
    this.placementTest,
    this.quizAudio,
    this.vocabulary,
    this.quizThreshold,
    this.interfaceChinese,
  });

  bool? audio;
  bool? dictionary;
  String? id;
  String? lang;
  String? language;
  bool? music;
  bool? pinyin;
  bool? quizAudio;
  bool? evaluation;
  bool? vocabulary;
  bool? placementTest;
  int? quizThreshold;
  bool? interfaceChinese;

  factory Settings.fromJson(Map<String, dynamic> json) => Settings(
      audio: json["audio"],
      dictionary: json["dictionary"],
      id: json["id"],
      lang: json["lang"],
      language: json["language"],
      music: json["music"],
      pinyin: json["pinyin"],
      quizAudio: json["quizAudio"],
      evaluation: json["evaluation"] ?? true,
      vocabulary: json["vocabulary"] ?? true,
      placementTest: json["placementTest"] ?? true,
      quizThreshold: json['quizThreshold'],
      interfaceChinese: json['interfaceChinese']);

  Map<String, dynamic> toJson() => {
        "audio": audio,
        "dictionary": dictionary,
        "id": id,
        "lang": lang,
        "language": language,
        "music": music,
        "pinyin": pinyin,
        "quizAudio": quizAudio,
        'evaluation': evaluation,
        'vocabulary': vocabulary,
        'placementTest': placementTest,
        "quizThreshold": quizThreshold,
        'interfaceChinese': interfaceChinese
      };
}


// // 为了不影响别的settings，暂时加上 Nov 18
// class ClassSettings {
//   ClassSettings({
//     this.audio,
//     this.dictionary,
//     this.evaluation,
//     this.id,
//     this.lang,
//     this.language,
//     this.music,
//     this.pinyin,
//     this.placementTest,
//     this.quizAudio,
//     this.vocabulary,
//   });

//   bool? audio;
//   bool? dictionary;
//   String? id;
//   String? lang;
//   String? language;
//   bool? music;
//   bool? pinyin;
//   bool? quizAudio;
//   bool? evaluation;
//   bool? vocabulary;
//   bool? placementTest;

//   factory ClassSettings.fromJson(Map<String, dynamic> json) => ClassSettings(
//         audio: json["audio"],
//         dictionary: json["dictionary"],
//         id: json["id"],
//         lang: json["lang"],
//         language: json["language"],
//         music: json["music"],
//         pinyin: json["pinyin"],
//         quizAudio: json["quizAudio"],
//         evaluation: json["evaluation"],
//         vocabulary: json["vocabulary"],
//         placementTest: json["placementTest"],
//       );

//   Map<String, dynamic> toJson() => {
//         "audio": audio,
//         "dictionary": dictionary,
//         "id": id,
//         "lang": lang,
//         "language": language,
//         "music": music,
//         "pinyin": pinyin,
//         "quizAudio": quizAudio,
//         'evaluation': evaluation,
//         'vocabulary': vocabulary,
//         'placementTest': placementTest,
//       };
// }
